<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>设计阶段审批</title>


<link rel="stylesheet" href="css/vivo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
<link rel="stylesheet" href="css/common.css">

<script src="js/jquery-1.11.1.js"></script>
<script type="text/javascript" src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script> 
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/sharefunction.js"></script>
</head>
<script type="text/javascript">
		
	
	$(function(){
		
		//如果已经保存过了，则开启只读状态
		<c:if test="${not empty requestScope.designStage }">
			$("#designStage").find("input").attr("readonly",true);
			$("#designStage .Wdate").attr("disabled",true);
		</c:if>
		toolTip();
		
	})
	//修改字段标记记录变量
	<c:set var="marks" value="原数据"/>

</script>
<body>
	<div style="padding:0px 10px">
		<form id="designStage" method="post" action=""  onsubmit="return false;">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h5 class="panel-title">设计阶段</h5>
				</div>
				<div class="panel-body">
					<table cellpadding="10" cellspacing="5" class="mytable">
						<tr>
							<td width="70" class="td-right">设计时间</td>
							<td width="260"><input name="designDate" id="designDate" value="<fmt:formatDate value="${requestScope.designStage.designDate }" pattern="yyyy-MM-dd" />"
								class="Wdate" readonly="readonly" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" /> 
								<c:if test="${not empty requestScope.map.designDate }"><span class="toolTip mark-msg"data-tip="<fmt:formatDate  value="${requestScope.map.designDate }" type="both" pattern="yyyy-MM-dd" />">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
							<td width="70" class="td-right">设计名称</td>
							<td width="260"><input name="designName" id="designName"  class="toolTip" data-tip="${requestScope.designStage.designName }" value="${requestScope.designStage.designName }" />
								<c:if test="${not empty requestScope.map.designName }"><span class="toolTip mark-msg"data-tip="${requestScope.map.designName }">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
							<td width="70" class="td-right">设计单位</td>
							<td><input name="designUnit" id="designUnit" class="toolTip" data-tip="${requestScope.designStage.designUnit }" value="${requestScope.designStage.designUnit }" class="input_name" />
								<c:if test="${not empty requestScope.map.designUnit }"><span class="toolTip mark-msg" data-tip="${requestScope.map.designUnit }">
									<c:out value="${marks}"/></span>
								</c:if>
							</td>
						</tr>
					</table>
				</div>
			</div>
			<input type="hidden" id="entityId_id" name="id" value="${requestScope.designStage.id }"/>
			<input type="hidden" id="apId" name="apId" value="${requestScope.apId}"/>
			<c:if test="${requestScope.notPassExamine}">
				<!-- 修改时添加变更说明 -->
				<div style="margin:10px;"  id="approvalRemark">
					审批意见<textarea rows="3" name="approvalRemark"style="width:70%"></textarea><span style="color:red;">*</span>
				</div>
				<div style="width:100%;text-align:center; padding-top:0px">
						<button class="btn btn-danger radius my-btn"
							onclick="saveDesigns(0)" type="button">同意</button>
						<button class="btn btn-default radius"
							onclick="saveDesigns(1)" type="button">拒绝</button>
				</div>
			</c:if>
		</form>
	</div>
	<script type="text/javascript">
		
		function saveDesigns(opt){
			var url = "project/approval/disposeDesign";
			var apId = '${requestScope.apId }';
			var exDataId = '${exDataId}';
			var approvalRemark = $("textarea[name='approvalRemark']").val();
			if(apId!="" && apId!=null && apId!=undefined){
				if(approvalRemark==""){
					layer.alert("审批说明不能为空");
					layer.close(i);
					return null;
				}
			}
			var formData = {
					exDataId:exDataId,
		        	opt:opt,
		        	apId:apId,
		        	approvalRemark:approvalRemark
		    };
			disposeSave(opt,url,formData);
		}
		//关闭当前窗体
		function bnClose() {
			parent.layer.closeAll();
		}
	</script>
</body>
</html>

